<?php 

	$tags_arr = empty($tags) ? [] : explode(',', $tags);

?>
<div id="tags_container" style="margin:0px auto; width:1000px; margin-bottom:10px; font-size:14px"><!--
--><div style="display:inline-block;">标签相关：</div><!--
--><div style="display:inline-block;">
  全部<input type="checkbox" value="" style=""  /> 
  初中<input type="checkbox" value="junior" style=""  /> 
  高中<input type="checkbox" value="senior" style=""  /> 
  CET4<input type="checkbox" value="cet4" style=""/> 
  CET6<input type="checkbox" value="cet6" style=""/> 
  IELTS<input type="checkbox" value="ielts" style=""/> 
  </div><!--
--></div>
<script language="javascript">
function getTagsParam(){
	var checkboxs = $('#tags_container').find('input');

	var tags_str = "";
	for(var i=1; i<checkboxs.length; i++){
		if($(checkboxs[i]).is(':checked')){
			tags_str += ","+checkboxs[i].value;
		}
	}
	
	if(tags_str.length > 0){
		return tags_str.substring(1);
	}else{
		return "";
	}

}

(function(){
		  
	var tags = <?php echo json_encode($tags_arr, JSON_UNESCAPED_UNICODE)?>;
	var checkboxs = $('#tags_container').find('input');
	//console.log(getTagsParam());
	
	for(var i=0; i<tags.length; i++){
		if(tags[i] == "junior"){
			$(checkboxs[1]).attr("checked", true);
		}else if(tags[i] == "senior"){
			$(checkboxs[2]).attr("checked", true);
		}else if(tags[i] == "cet4"){
			$(checkboxs[3]).attr("checked", true);
		}else if(tags[i] == "cet6"){
			$(checkboxs[4]).attr("checked", true);
		}else if(tags[i] == "ielts"){
			$(checkboxs[5]).attr("checked", true);
		}
	}

	
})();

</script>
